<div class="layui-body">
	<div class="aright">
	<div class="arz cl"><a href="{:url('man/ad/add_pic')}"><i class="layui-icon">&#xe608;</i>添加广告</a></div>
	<form method="post" class="aform cl" >
	<table width="100%">
	      <tr>

			<th width="5%" align="center">ID编号</th>
	        <th width="15%" align="center">图片预览</th>
	
	        <th width="15%" align="center">链接地址</th>
			<th width="4%" align="center">首页尾广告</th>
			<th width="4%" align="center">题目头广告</th>
			<th width="4%" align="center">题目尾广告</th>
			<th width="4%" align="center">答案头广告</th>
			<th width="4%" align="center">答案尾广告</th>
			<th width="9%" align="center">添加时间</th>
	        <th width="9%" align="center">基本操作</th>
	      </tr>
	      {volist name="pics" id="vo"}

			<td align="center">{$vo.id}</td>
	        <td align="center"><img src="{$vo.pname}" height="50"></td>
			<td align="center">{$vo.plink}</td>
			<td align="center">{if condition="$vo['ptypea'] eq 2"}<span style="color:#FF5722;">是</span>{else /}否{/if}</td>
			<td align="center">{if condition="$vo['ptypeb'] eq 2"}<span style="color:#FF5722;">是</span>{else /}否{/if}</td>
			<td align="center">{if condition="$vo['ptypec'] eq 2"}<span style="color:#FF5722;">是</span>{else /}否{/if}</td>
			<td align="center">{if condition="$vo['ptyped'] eq 2"}<span style="color:#FF5722;">是</span>{else /}否{/if}</td>
			<td align="center">{if condition="$vo['ptypee'] eq 2"}<span style="color:#FF5722;">是</span>{else /}否{/if}</td>
			<td align="center">{$vo.ptime|date="Y-m-d H:i:s",###}</td>
	        <td align="center"><a href="{:url('man/ad/edit_pic',array('id'=>$vo['id']))}">修改</a> | <a  onclick="deleted({$vo.id})">删除</a>
	        </td>
	      </tr>
	      {/volist}
	 </table>

	 </form>
	 		 
	</div>
	</div>
</div>
<script>
layui.use('layer',function(){
	var layer = layui.layer;
})
function deleted(aid){
	$.post("{:url('man/ad/delete')}",{'aid':aid,'type':1},function(data){
		if(data){
			layer.msg("删除成功");
			setTimeout(function(){
				window.location.reload();
			},1000);
			
		}
	})
}
</script>